<!DOCTYPE html>
<html>
<head>
    <title>拨号确认</title>
    <script>
        function decryptNumber(encoded) {
            return atob(encoded); // Base64解码
        }
        function initiateCall() {
            const urlParams = new URLSearchParams(window.location.search);
            const encodedNumber = urlParams.get('num');
            if (!encodedNumber) return;
            const phoneNumber = decryptNumber(encodedNumber);
            window.location.href = `tel:${phoneNumber}`; // 唤起拨号
        }
        function closePage() {
            window.history.back(); // 返回或关闭
        }
        window.onload = function() {
            const encoded = new URLSearchParams(window.location.search).get('num');
            if (encoded) {
                const num = decryptNumber(encoded);
                if (confirm(`是否拨打车主电话：${num}？`)) {
                    initiateCall();
                } else {
                    closePage();
                }
            }
        };
    </script>
</head>
<body>
</body>
</html>